<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
    'name' => 'www.szhr360.com',
    'language' => 'zh_cn',
    // preloading 'log' component
    'preload' => array('log'),
    // autoloading model and component classes
    'import' => array(
        'application.models.*',
        'application.components.*',
    ),
    'modules' => array(
        'gii' => array(
            'class' => 'system.gii.GiiModule',
            'password' => 'ddd',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters' => array('127.0.0.1', '::1'),
        ),
        'wiiadmin',
        'sitemap' => array(
            'class' => 'ext.sitemap.SitemapModule', //or whatever the correct path is
            'actions' => array(
                '/',
                array(
                    'route' => 'posts/view',
                    'params' => array(//specify action parameters
                        'model' => array(
                            'class' => 'posts',
                            'criteria' => array(),
                            'map' => array(
                                'alias' => 'post_alias',
                            ),
                        ),
                    ),
                ),
                array(
                    'route' => 'categorys/list',
                    'params' => array(
                        'model' => array(
                            'class' => 'categorys',
                            'criteria' => array('condition' => "category_type<>'page'"),
                            'map' => array(
                                'alias' => 'category_alias',
                            ),
                        ),
                    ),
                ),
                array(
                    'route' => 'categorys/view',
                    'params' => array(
                        'model' => array(
                            'class' => 'categorys',
                            'criteria' => array('condition' => "category_type='page'"),
                            'map' => array(
                                'alias' => 'category_alias',
                            ),
                        ),
                    ),
                ),
            ), //optional
            'absoluteUrls' => true, //optional
            'protectedControllers' => array('wiiadmin'), //optional
            'protectedActions' => array('site/error'), //optional
            //'priority' => '0.5', //optional
            'changefreq' => 'always', //optional
            //'lastmod' => date('Y-m-d'), //optional
            'cacheId' => 'mapCache', //optional
            'cachingDuration' => 3600, //optional      
        ),
    ),
    'defaultController' => 'site',
    // application components
    'components' => array(
        'user' => array(
            // enable cookie-based authentication
            'allowAutoLogin' => true,
        ),
        //sqlite
        /*
          'db' => array(
          'connectionString' => 'sqlite:protected/data/blog.db',
          'tablePrefix' => 'tbl_',
          ),
         * */
        // uncomment the following to use a MySQL database
        'db' => array(
            'connectionString' => 'mysql:host=localhost;dbname=wiicms',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => '111111',
            'charset' => 'utf8',
            'tablePrefix' => '',
        ),
        'errorHandler' => array(
            // use 'site/error' action to display errors
            'errorAction' => 'site/error',
        ),
        'urlManager' => array(
            'urlFormat' => 'path',
            'showScriptName' => false,
            'rules' => array(
                'rss' => 'site/rss',
                'sitemap.xml' => 'sitemap/default/index',
                'sitemap' => 'sitemap/default/index/format/html',
                'login' => 'site/openIDLogin',
                'post/<alias:.*?>' => 'posts/view',
                'faq/<alias:.*?>' => 'categorys/faq',
                'category/<alias:.*?>' => 'categorys/list',
                'site/<alias:.*?>' => 'categorys/view',
                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
            ),
        ),
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'error, warning',
                ),
            // uncomment the following to show log messages on web pages
            /*
              array(
              'class'=>'CWebLogRoute',
              ),
             */
            ),
        ),
    ),
    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params' => require(dirname(__FILE__) . '/params.php'),
);